home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 June
/
Chip_2004-06_cd1.bin
/
software
/
tsw
/
tsw.exe
/
{app}
/
scripts
/
phpsinglelinecomment.tss
< prev
next >
Wrap
Text File
|
2003-07-09
|
552b
|
30 lines
{
[Scriptsettings]
Scriptname=PHP singleline comment
ExecuteOnStartup=0
ExecuteOnlyOnce=0
}
program PHPSingleLineComment;
function CommentIt(s: string) : string;
var
TempList: TStringList;
Temp: string;
i: integer;
begin
TempList := TStringList.Create;
TempList.Text := s;
for i := 0 to TempList.Count - 1 do
if TempList.Strings[i] <> '' then
Temp := Temp + '//'+TempList.Strings[i]+#13#10;
TempList.Free;
Result := Temp;
end;
var
Code: string;
begin
Code := GetSelText;
SetSelText(CommentIt(Code));
end.